﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Windows.Media.Imaging;

namespace CarBloke
{
    public class ZodiacImage
    {
        public static BitmapImage GetZodiacImage(DateTime date)
        {
            return new BitmapImage(new Uri("../Images/Zodiac/" + ZodiacSign(date) + ".png", UriKind.Relative));            
        }

        private static String ZodiacSign(DateTime date)
        {
            switch (date.Month)
            {
                case 1: 
                    if (date.Day <= 20)
                    {
                        return "Capricorn";
                    }
                    else
                    { 
                        return "Aquarius"; 
                    }
                case 2: 
                    if (date.Day <= 19)
                    {
                        return "Aquarius"; }
                    else
                    { 
                        return "Pisces"; 
                    }
                case 3: 
                    if (date.Day <= 20)
                    {
                        return "Pisces"; }
                    else
                    { 
                        return "Aries"; 
                    }
                case 4: 
                    if (date.Day <= 20)
                    {
                        return "Aries"; }
                    else
                    { 
                        return "Taurus"; 
                    }
                case 5: 
                    if (date.Day <= 21)
                    {
                        return "Taurus"; 
                    }
                    else
                    { 
                        return "Gemini"; 
                    }
                case 6: 
                    if (date.Day <= 22)
                    {
                        return "Gemini"; 
                    }
                    else
                    {
                        return "Cancer"; 
                    }
                case 7: 
                    if (date.Day <= 22)
                    {
                        return "Cancer"; 
                    }
                    else
                    {
                        return "Leo"; 
                    }
                case 8: 
                    if (date.Day <= 23)
                    {
                        return "Leo"; 
                    }
                    else
                    {
                        return "Virgo"; 
                    }
                case 9: 
                    if (date.Day <= 23)
                    {
                        return "Virgo"; 
                    }
                    else
                    {
                        return "Libra"; 
                    }
                case 10: 
                    if (date.Day <= 23)
                    {
                        return "Libra"; 
                    }
                    else
                    { 
                        return "Scorpio"; 
                    }
                case 11: 
                    if (date.Day <= 22)
                    {
                        return "Scorpio"; 
                    }
                    else
                    {
                        return "Sagittarius"; 
                    }
                case 12: 
                    if (date.Day <= 21)
                    {
                        return "Sagittarius"; 
                    }
                    else
                    {
                        return "Capricorn"; 
                    }                    
            }

            return String.Empty;
        }
    }
}
